FILE(GLOB SRC *.cpp)
FILE(GLOB PRIV_H *.h)
FILE(GLOB SRC_STATIC_TABLE static_table/*.h static_table/*.cpp)

SOURCE_GROUP("static_table" FILES ${SRC_STATIC_TABLE})
SOURCE_GROUP(headers FILES ${PRIV_H})


# Filter out the source files not actually compiled.
#LIST(REMOVE_ITEM SRC ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.cpp)
#LIST(REMOVE_ITEM PRIV_H ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.h)

NL_TARGET_LIB(gameshare ${PRIV_H} ${SRC} ${SRC_STATIC_TABLE})

INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

TARGET_LINK_LIBRARIES(gameshare nelmisc nelnet ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
NL_DEFAULT_PROPS(gameshare "EVA, Library: Game Share")
NL_ADD_RUNTIME_FLAGS(gameshare)
NL_ADD_LIB_SUFFIX(gameshare)

ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})

IF(WITH_PCH)
  ADD_NATIVE_PRECOMPILED_HEADER(gameshare ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH)

IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
  INSTALL(TARGETS gameshare LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries)
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
